﻿using System;
using System.Collections.Generic;
using System.Text;

namespace X3DLib
{
    public class Sphere:Gemeotry
    {
        private string Radius;

        public string radius
        {
            get { return Radius; }
            set { Radius = value; }
        }

        public Sphere():base()
        {
            
        }

        public Sphere(string radius):base()
        {
            this.radius = radius;
        }
        public override string getAttrs()
        {
            return  "DEF|" + this.DEF + "|string,"
                    + "USE|" + this.USE + "|string,"
                    + "size|" + (this.radius   == null ? "1" : this.radius ) + "|float";
        }
        public override void setAttrs(string attrs)
        {
            string[][] temp = X3DString.getArrayByAttrs(attrs);
            for (int i = 0; i < temp.Length; i++)
            {
                switch (temp[i][0])
                {
                    case "DEF":
                        this.DEF = temp[i][1];
                        break;
                    case "USE":
                        this.USE = temp[i][1];
                        break;
                    case "radius":
                        this.radius = temp[i][1];
                        break;
                }
            }
        }
    }
}
